package cn.darksoul3.springcloud.conrroller;

import cn.darksoul3.common.result.ObjectResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class tick {

    @Value(value = "${server.port}")
    private String port;

    @GetMapping(value = "/tick")
    public ObjectResult tick(){
        log.info("this is tick");
        return ObjectResult.succeed(this.port);
    }

    @GetMapping(value = "/tout")
    public ObjectResult tout() throws InterruptedException {
        log.info("this is time out");
        Thread.sleep(3000L);
        return ObjectResult.succeed(this.port);
    }
}
